import stockApi from '@/api/declaration/erp/stockApi'
import httpRequest from '@/config/axios/httpRequest'


// ERP 产品库存 API
export const StockApi = {
  // 查询产品库存分页
  getStockPage: async (params: any) => {
    return await httpRequest.get(stockApi.GetStockQtyPage, { params })
  },

  // 查询产品库存详情
  getStock: async (id: number) => {
    return await httpRequest.get(stockApi.GetStock, { params: { id } })
  },

  // 查询产品库存详情
  getStock2: async (productId: number, warehouseId: number) => {
    return await httpRequest.get(stockApi.GetStockDetail, { params: { productId, warehouseId } })
  },

  // 获得产品库存数量
  getStockCount: async (productId: number) => {
    return await httpRequest.get(stockApi.GetStockCount, { params: { productId } })
  },

  // 导出产品库存 Excel
  exportStock: async (params) => {
    return await httpRequest.download(stockApi.ExportStock, params)
  }
}
